package org.github.manx98.jlibhac.tools.ncm;

import lombok.Data;
import org.github.manx98.jlibhac.fs.IStorage;

import java.io.IOException;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/6 18:53
 */
@Data
public class CnmtPrevContent {
    public byte[] NcaId;
    public long Size;
    public ContentType Type;

    public CnmtPrevContent(IStorage reader) throws IOException {
        NcaId = reader.readBytes(0x10);
        Size = reader.readUint32().longValue();
        Size |= (long) reader.readUint16().longValue() << 32;
        Type = ContentType.valueOf(reader.readByte());
        reader.setPosition(reader.getPosition() + 1);
    }
}
